class Node {
    private Object element; // element stored in this node
    private Node   next;    // reference to the next node in the list
// constructors

    public Node() { //# create a node with a null element and next reference
        this(null, null);
    }

    public Node(Object e, Node n) { //# create a node given element and next
        element = e;
        next = n;
    }
    // update methods

    public void setElement(Object newElem) {
        element = newElem;
    }

    public void setNext(Node newNext) {
        next = newNext;
    }

// accessor methods
    public Object getElement() {
        return element;
    }

    public Node getNext() {
        return next;
    }
} // end of class node
